#include <stdio.h>
#include <stdlib.h>

struct datas
{
    int iData;
    float fData;
    double dData;
    char cData;
};

typedef struct datas MyData;

int main(int argc, char ** argv)
{
    struct datas data1;
    data1.iData = 10;
    data1.fData = 10.01f;
    data1.dData = 123.456;
    data1.cData = 'A';

    printf("data1.iData = %d\n", data1.iData);
    printf("data1.fData = %f\n", data1.fData);
    printf("data1.dData = %f\n", data1.dData);
    printf("data1.cData = %c\n", data1.cData);

    MyData * p = &data1;
    p->iData = 101;
    p->fData = 12.34f;
    p->dData = 1234.56;
    p->cData = 'B';

    printf("data1.iData = %d\n", data1.iData);
    printf("data1.fData = %f\n", data1.fData);
    printf("data1.dData = %f\n", data1.dData);
    printf("data1.cData = %c\n", data1.cData);

    p = (struct datas*)malloc(sizeof(MyData));
    p->iData = 102;
    p->fData = 3.14f;
    p->dData = 1.41421;
    p->cData = 'C';

    printf("p->iData = %d\n", p->iData);
    printf("p->fData = %f\n", p->fData);
    printf("p->dData = %f\n", p->dData);
    printf("p->cData = %c\n", p->cData);

    free(p);

    return 0;
}